/**
 * ==============================================
 * Created by Finger Technology.
 * Author: ZhiHuaWei <zhihua_wei@foxmail.com>
 * Date: 2020/3/29 15:07
 * Project: YunAdmin后台管理系统
 * Version: 1.0.0
 * Power: config.js
 * ==========================================
 */
/*
KindEditor.ready(function (K) {
    window.editor = K.create('#editor', {
        width: '75%',
        height: '250px',
        items: [
            'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
            'plainpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', 'clearhtml', '|', 'fullscreen', '/',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
            'selectall', 'table', 'hr', 'emoticons', 'pagebreak',
            'anchor', 'link', 'unlink', '|', 'about'
        ],
        uploadJson:"{:url('admin/uploads/uploadKindEditorImg')}",
    });
});

$(function () {
    $(".config-group").click(function () {
        var url = $(this).attr('val');
        window.location.href = url;
    });
});*/


//表单提交验证
var Script = function () {

    'use strict';

    $.validator.setDefaults({
        submitHandler: function (form) {
            form.submit();
        }
    });

    $().ready(function () {
        $("#configForm").validate({
            rules: {
                group: {
                    required: true
                },
                title: {
                    required: true
                },
                name: {
                    required: true
                },
                form_type: {
                    required: true
                },
                tip: {
                    required: true
                }
            },

            messages: {
                group: "请选择配置分组！",
                title: "请填写配置标题！",
                name: "请输入配置名称！",
                form_type: "请选择配置类型！",
                tip: "请输入配置说明！"
            }
        });
    });

}();
